package model

import (
	"engine/consts"
	"time"
)

type SysError struct {
	Id           uint64                `gorm:"column:id;type:bigint(20) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
	ErrorCode    string                `gorm:"column:error_code;type:varchar(128);NOT NULL" json:"errorCode"`
	LastHappened *time.Time            `gorm:"column:last_happened;type:datetime;NOT NULL" json:"lastHappened"`
	Status       consts.SysErrorStatus `gorm:"column:status;type:enum('pending','processing','ignore','done');default:pending;NOT NULL" json:"status"`
	Msg          string                `gorm:"column:msg;type:longtext;NOT NULL" json:"msg"`
	Remark       string                `gorm:"column:remark;type:varchar(1024)" json:"remark"`
	ProcessedBy  *uint64               `gorm:"column:processed_by;type:bigint(20) unsigned" json:"processedBy"`
	ProcessedAt  *time.Time            `gorm:"column:processed_at;type:timestamp;comment:处理时间" json:"processedAt"`
	CreatedAt    time.Time             `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP;NOT NULL" json:"createdAt"`
	UpdatedAt    *time.Time            `gorm:"column:updated_at;type:timestamp" json:"updatedAt"`
}
